import 'package:json_annotation/json_annotation.dart';

part 'bean.g.dart';

@JsonSerializable()
class RequestModel {
  String? code;
  String? info;
  @JsonKey(name: "snum")
  String? sNum = "";
  @JsonKey(name: "userid")
  int? userId = 0;

  RequestModel(this.code, this.info, {this.sNum, this.userId});

  factory RequestModel.fromJson(Map<String, dynamic> json) =>
      _$RequestModelFromJson(json);

  Map<String?, dynamic> toJson() => _$RequestModelToJson(this);
}

class ResponseModel {
  int? error = 0; //业务状态码(0:正常；<0：错误)
  String? msg = ""; //业务状态对应提示
  dynamic data; //返回内容主题，序列化的对象，JSON格式

  ResponseModel();

  factory ResponseModel.fromJson(Map<String?, dynamic> json) {
    return ResponseModel()
      ..error = json['error']
      ..msg = json['msg']
      ..data = json['data'];
  }
}

@JsonSerializable()
class NewsData extends Object {
  int? D_ID;
  int? D_ClassID;
  String? D_Title;
  String? D_picture;
  int? D_Num;
  int? D_Count;
  int? D_Recycle;
  int? D_WeborWap;
  int? D_Hot;
  int? D_TopicID;
  String? D_WBUrl;

  NewsData();

  factory NewsData.fromJson(Map<String, dynamic> srcJson) =>
      _$NewsDataFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$NewsDataToJson(this);
}

@JsonSerializable()
class CommandInfo extends Object {
  int? id;
  String? command;
  String? desc;

  CommandInfo();

  factory CommandInfo.fromJson(Map<String, dynamic> srcJson) =>
      _$CommandInfoFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$CommandInfoToJson(this);
}

@JsonSerializable()
class ApiCode extends Object {
  int? id;
  String? code;
  String? introduce;

  ApiCode();

  factory ApiCode.fromJson(Map<String, dynamic> srcJson) =>
      _$ApiCodeFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$ApiCodeToJson(this);
}

@JsonSerializable()
class BoardInfo extends Object {
  String? code;
  String? deviceid;
  int? areaId;
  String? areaname;
  String? ip;
  int? boardid;
  dynamic lastlogintime;
  int? status;
  int? deptId;
  String? deptName;
  int? isStockRemoval;
  int? allocation;
  String? account;
  String? userid;
  int? isDistribution;
  int? country;
  String? countryName;
  String? checkBoxValue;
  int? isAgreeInstall;
  int? isAgreeDownload;
  String? addtime;
  int? notice;
  String? userName;
  int? isAgreeGetYKWQ;

  BoardInfo();

  factory BoardInfo.fromJson(Map<String, dynamic> srcJson) =>
      _$BoardInfoFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$BoardInfoToJson(this);
}

@JsonSerializable()
class RoleAdmin extends Object {
  int? id;
  String? intro;

  RoleAdmin();

  factory RoleAdmin.fromJson(Map<String, dynamic> srcJson) =>
      _$RoleAdminFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$RoleAdminToJson(this);
}

@JsonSerializable()
class Medicine extends Object {
  int? id;
  String? name;
  String? function;
  String? note;
  Medicine();

  factory Medicine.fromJson(Map<String, dynamic> srcJson) =>
      _$MedicineFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$MedicineToJson(this);
}

@JsonSerializable()
class AppMarketInfo extends Object {
  int? id;
  String? platform;
  String? account;
  String? password;
  String? url;
  @JsonKey(name: "debug_url")
  String? debugurl;

  String? note;
  @JsonKey(name: "analysis_url")
  String? analysisUrl;

  AppMarketInfo();

  factory AppMarketInfo.fromJson(Map<String, dynamic> srcJson) =>
      _$AppMarketInfoFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$AppMarketInfoToJson(this);
}

@JsonSerializable()
class IpInfo extends Object {
  String? continent;
  String? country;
  String? zipcode;
  String? timezone;
  String? accuracy;
  String? owner;
  String? isp;
  String? source;
  String? areacode;
  String? adcode;
  String? asnumber;
  String? lat;
  String? lng;
  String? radius;
  String? prov;
  String? city;
  String? district;
  String? ip;

  IpInfo();

  factory IpInfo.fromJson(Map<String, dynamic> srcJson) =>
      _$IpInfoFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$IpInfoToJson(this);
}

@JsonSerializable()
class BoardCommand extends Object {
  int? id;
  String? command;
  String? desc;

  BoardCommand();

  factory BoardCommand.fromJson(Map<String, dynamic> srcJson) =>
      _$BoardCommandFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$BoardCommandToJson(this);
}

@JsonSerializable()
class ReportInfo extends Object {
  int? id;
  int? type;
  int? source;
  int? userid;
  String? userName;
  String? description;
  int? sourceId;

  ReportInfo();

  factory ReportInfo.fromJson(Map<String, dynamic> srcJson) =>
      _$ReportInfoFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$ReportInfoToJson(this);
}

class ImageSize {
  int? width;
  int? height;
  bool? isMaintainAspect;
}

@JsonSerializable()
class BalanceScore extends Object {
  String? level;
  double? overall;
  @JsonKey(name: "overall_rs")
  double? overAllRs;
  double? opening;
  @JsonKey(name: "opening_rs")
  double? openingRs;
  @JsonKey(name: "early_middle_game")
  double? earlyMiddleGame;
  @JsonKey(name: "early_middle_game_rs")
  double? earlyMiddleGamers;
  @JsonKey(name: "middle_game")
  double? middleGame;
  @JsonKey(name: "middle_game_rs")
  double? middleGamers;
  @JsonKey(name: "late_middle_game")
  double? lateMiddleGame;
  @JsonKey(name: "late_middle_game_rs")
  double? lateMiddleGamers;
  double? endgame;
  @JsonKey(name: "endgame_rs")
  double? endGamers;

  BalanceScore();

  factory BalanceScore.fromJson(Map<String, dynamic> srcJson) =>
      _$BalanceScoreFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$BalanceScoreToJson(this);
}

@JsonSerializable()
class CountResult {
  String? result;
  String? board_state;
  late double whiteWinRate;
  late double whiteWinScore;
  double? uncertain_score;

  CountResult();

  factory CountResult.fromJson(Map<String, dynamic> json) =>
      _$CountResultFromJson(json);

  Map<String, dynamic> toJson() => _$CountResultToJson(this);
}

@JsonSerializable()
class AIRole {
  int? id;
  int? style;
  String? name;
  String? desc;
  List<AILevel>? aiLevels;

  AIRole();

  factory AIRole.fromJson(Map<String, dynamic> srcJson) =>
      _$AIRoleFromJson(srcJson);

  Map<String, dynamic> toJson() => _$AIRoleToJson(this);
}

@JsonSerializable()
class AILevel extends Object {
  int? id;
  int? level;
  String? name;
  String? introduce;

  AILevel();

  factory AILevel.fromJson(Map<String, dynamic> srcJson) =>
      _$AILevelFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$AILevelToJson(this);
}

@JsonSerializable()
class GameRoomLivingDetail {
  int? id;
  String? nowtime;
  int? f_match_state;
  int? f_blackid;
  int? f_whiteid;
  int? f_roomnum;
  int? f_num;
  int? f_state;
  String? f_position;
  String? f_allstep;
  String? f_lastplaytime;
  int? f_blackleft;
  int? f_whiteleft;
  String? f_result;
  String? f_ruler;
  String? blackname;
  String? whitename;
  String? f_revisiontime;
  String? f_add_user;
  String? f_roomtype;
  String? bLevelName;
  String? wLevelName;
  String? bLevel;

  String? wLevel;

  GameRoomLivingDetail();

  factory GameRoomLivingDetail.fromJson(Map<String, dynamic> json) =>
      _$GameRoomLivingDetailFromJson(json);

  Map<String, dynamic> toJson() => _$GameRoomLivingDetailToJson(this);
}

@JsonSerializable()
class LoginUser {
  String? images;
  int userid = 0;
  String? account;
  String? realname;
  int? usertype;
  int? parentid;
  String? dypassword;
  String? tel;
  String? level;
  String? chessname;
  int? chessid;
  String? permission;
  String? ruler;
  int? roomtype;
  String? winning;
  String? score;
  int? integralcount;
  int? levelid;
  int? yquser;
  String? viptime;
  int? vipdate;
  int? ifaccept;
  String? authority;
  int? changeState;
  @JsonKey(ignore: true)
  double? upgradeProcess;
  int? sign;
  String? boardCode;

  LoginUser();

  factory LoginUser.fromJson(Map<String, dynamic> srcJson) =>
      _$LoginUserFromJson(srcJson);

  Map<String, dynamic> toJson() => _$LoginUserToJson(this);
}

@JsonSerializable()
class AreaInfo extends Object {
  int? id;
  int? centerId;
  String? deptName;
  String? areaCode;
  String? areaName;

  AreaInfo();

  factory AreaInfo.fromJson(Map<String, dynamic> srcJson) =>
      _$AreaInfoFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$AreaInfoToJson(this);
}

@JsonSerializable()
class BoardDetail extends Object {
  String? code;
  String? deviceid;
  int? areaId;
  String? areaname;
  int? deptId;
  String? deptName;
  int? isStockRemoval;
  int? allocation;
  String? account;
  int? isDistribution;
  int? country;
  String? countryName;
  int? isAgreeInstall;
  String? addtime;
  int? notice;
  int? isAgreeDownload;
  int? isAgreeGetYKWQ;

  BoardDetail();

  factory BoardDetail.fromJson(Map<String, dynamic> srcJson) =>
      _$BoardDetailFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$BoardDetailToJson(this);
}

@JsonSerializable()
class ClassInfo extends Object {
  int? id;
  int? classid;
  String? classname;
  int? teacherid;
  String? chess;
  String? classlevel;
  String? year;
  String? addtime;
  int? parentid;
  int? sum;
  int? catalogid;
  String? chessname;
  int? roomid;
  int? checktotal;
  int? schedulecount;
  String? teachername;
  int? status;

  ClassInfo();

  factory ClassInfo.fromJson(Map<String, dynamic> srcJson) =>
      _$ClassInfoFromJson(srcJson);

  Map<String?, dynamic> toJson() => _$ClassInfoToJson(this);
}
